
import mockjs from 'mockjs';
import { delay } from 'roadhog-api-doc';

const proxy = {
  'POST /api/test/result': (req, res) => res.send(mockjs.mock({
    // 每次请求均产生随机值
    'content': {
      'number|1-100': 100,
    },
    success: true,
    message: '123',
  })),
  'GET /api/types': (req, res) => res.send(mockjs.mock({
    'content|100': [{ name: '@city', 'value|1-100': 50, 'type|0-2': 1 }],
    success: true,
    message: '123',
  })),
  '/api/v1/dtwave_light_backend/user_tags': (req, res) => res.send(mockjs.mock({
    "code": 0,
    "content": {
      "latestTag": {
        "ctime": "2020-01-10 15:00:00",
        "tagId": 1,
        "tagName": "乐于助人"
      },
      "tags|17": [
        {
          "tagId": 1,
          "tagName": "乐于助人",
          "times": 5
        }
      ]
    },
    success: true,
    "message": null
  })),
  'GET /api/v1/dtwave_light_backend/tags': (req, res) => res.send(mockjs.mock({
    "code": 0,
    "content|20": [
      {
        "tagId|+1": 1,
        "tagName": "@name"
      }
    ],
    success: true,
    "message": null
  })),
  'GET /api/v1/dtwave_light_backend/users_random_base_info': (req, res) => res.send(mockjs.mock({
    "code": 0,
    "content|9": [
      {
        "userId|+1": 1,
        "nickname": "@name",
        'avartart': "https://img3.doubanio.com/view/photo/albumcover/public/p2535888193.webp"
      }
    ],
    success: true,
    message: '123',
  })),
  'GET /api/v1/dtwave_light_backend/users_base_info': (req, res) => res.send(mockjs.mock({
    "code": 0,
    "content|10": [
      {
        "userId|+1": 1,
        "userName": "@name",
      }
    ],
    success: true,
    message: '123',
  })),
  'GET /dtwave_light/api/v1/dtwave_light_backend/user': (req, res) => res.send(mockjs.mock({
    "code": 0,
    "content": {
      "baseUser": {
        "userId": 1,
        "userName": "夏见明",
        "nickname": "龙马",
        "jobNumber": "330",
        "hiredDate": "2020-01-09",
        "position": "研发工程师",
        "avatar": "https://static-legacy.dingtalk.com/media/lADPDgQ9qiIDSxnNC9DNC9U_3029_3024.jpg"
      },
      "workHour": null,
      "meeting": null,
      "weekly": {
        "joinProjectCount": 5,
        "workPersonDay": 120,
        "overtimePersonDay": 88,
        "longestWorkProjectName": "旭辉",
        "longestWorkProjectRate": "30.20%",
        "workType": "后端开发"
      },
      "approval": null,
      "travel": null,
      "teamBuilding": null,
      "shackleton": null
    },
    success: true,
    message: null,
  }))
}

export default delay(proxy, 1000);